<template>
  <div class="box">
    <h1>组件间通信: $attrs与$listeners</h1>
    <h2>需求: 自定义带Hover提示的按钮</h2>

    <HintButton type="primary" :size="size" icon="el-icon-edit" content="编辑" @click="sendadd"> </HintButton>

    <!-- <HintButton type="danger" size="small" icon="el-icon-delete" content="删除"></HintButton> -->
  </div>
</template>

<script>
// 导入组件
import HintButton from './HintButton.vue'
export default {
  name: 'AttrsListenersTest',
  data() {
    return {
      size: 'default'
    }
  },
  // 注册
  components: {
    HintButton
  },
  methods: {
    sendadd() {
      //   console.log(111)
      this.size = 'mini'
    }
  }
}
</script>

<style scoped></style>
